import time

from appium.common.logger import logger
from appium.webdriver.common.appiumby import AppiumBy

from base.wecom_app import WeComApp


class AddMemberPage(WeComApp):

    # 手动输入添加按钮
    _MANUAL_INPUT_BTN = AppiumBy.XPATH, "//*[@text='手动输入添加']"

    def goto_manual_input_page(self):
        logger.info("点击【手动输入添加】按钮")
        self.find_and_click(*self._MANUAL_INPUT_BTN)

        # 跳转手动添加页面
        from page.manual_input_page import ManualInputPage
        return ManualInputPage(self.driver)

    def get_toast_tips(self):

        logger.info("获取toast文本")
        toast_txt = self.get_tips()
        logger.info(toast_txt)
        return toast_txt

